#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <climits>
#include <regex>
using namespace std;

int main() {
    int n, k;
    long long happy[10010];
    long long sad[10010];

    cin >> n >> k;

    for (int i = 0; i < n; i++)
    {
        cin >> happy[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> sad[i];
    }


    int left = 0, right = 0, maxhappy = 0, minsad = INT_MAX, numa = 0, numi = 0;
    int ret = 0;
    while (right <= n)
    {
        if (right - left == k)
        {
            if (maxhappy < numa)
            {
                maxhappy = numa;
                minsad = numi;
                ret = left;
            }
            else if (maxhappy == numa)
            {
                if (minsad > numi)
                {
                    ret = left;
                    minsad = numi;
                }
            }


            numa -= happy[left];
            numi -= sad[left];
            left--;
        }
        if (right != n)
        {
            numa += happy[right];
            numi += sad[right];
        }
        right++;
    }

    cout << ret;
    return 0;


}